﻿using AbpApplication.AppServices;
using AbpApplication.Expand;
using AbpApplication.Flurl;
using AbpEntityFrameworkcore;
using AbpEntityFrameworkcore.DbContext;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NLog.Extensions.Logging;
using System.Security.Principal;
using Volo.Abp.Application;
using Volo.Abp.AutoMapper;
using Volo.Abp.FluentValidation;
using Volo.Abp.Modularity;

namespace AbpApplication
{
    [DependsOn(
        typeof(AbpDddApplicationModule),
        typeof(AbpEntityFrameworkcoreModule),
          typeof(AbpFluentValidationModule),
           typeof(AbpAutoMapperModule)
   
        )]


    public class AbpApplicationModule:AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {

            Configure<AbpAutoMapperOptions>(opt =>
            {
                opt.AddProfile<JobToDddProfile>();
            });
            context.Services.AddLogging(loggBuilder =>
            {
         
                loggBuilder.AddNLog( new NLogProviderOptions() { RemoveLoggerFactoryFilter=false}); 
            });
            context.Services.AddAbpDbContext<MyDbContext>();
            context.Services.AddScoped<QueryDynamic_View_TaskOrder>();
            context.Services.AddScoped<QueryDynamic>();
            context.Services.AddScoped<ILoginHelper,LoginHelpers>();
            context.Services.AddScoped<IConsumerService,ConsumerService>();
            context.Services.AddScoped<IToOutSideInterFace,ToOutSideInterFace>();
            context.Services.AddScoped<IEssService, EssService>();
            context.Services.AddMediatR(config =>
            {
                config.RegisterServicesFromAssemblyContaining(typeof(AbpApplicationModule));
            });





        }
    }
}